package com.lzy.crm.wechat.vo;

import java.io.Serializable;
import java.io.UnsupportedEncodingException;

import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;

import com.lzy.crm.base.util.CommonConstant;



public class WeChatHeader implements Serializable {
	
	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;

	private static final Logger logger = LogManager.getLogger(WeChatHeader.class);
	
	/**
	 * openId
	 */
	private String openId;       // 外部平台用户唯一id（例如openId）',
	
	private String publicAccountId ;  // 公众号ID
	
	private String userName;    // 用户昵称

	private String jsapiTicket;    // 签名
	
	private String unionid;
	// 缓存支付的信息
	
	private String timeStamp;
	private String nonceStr;
	private String packagestring;
	private String paySign;
	private String signType;
	private String signature;
	
	
	/**
	 * 对userName进行解码
	 */
	public void decodeUserName() {
		if (userName != null && userName.length() != 0) {
			try {
				userName = new String(userName.getBytes(CommonConstant.ENCODING_ISO8859_1), CommonConstant.ENCODING);
				logger.info("validate->after decode:userName: {}", userName);
			} catch (UnsupportedEncodingException e) {
				throw new RuntimeException(e);
			}
		}
	}
	


	public String getTimeStamp() {
		return timeStamp;
	}

	public void setTimeStamp(String timeStamp) {
		this.timeStamp = timeStamp;
	}





	public String getNonceStr() {
		return nonceStr;
	}





	public void setNonceStr(String nonceStr) {
		this.nonceStr = nonceStr;
	}





	public String getPackagestring() {
		return packagestring;
	}





	public void setPackagestring(String packagestring) {
		this.packagestring = packagestring;
	}





	public String getPaySign() {
		return paySign;
	}





	public void setPaySign(String paySign) {
		this.paySign = paySign;
	}





	public String getSignType() {
		return signType;
	}





	public void setSignType(String signType) {
		this.signType = signType;
	}





	public String getSignature() {
		return signature;
	}





	public void setSignature(String signature) {
		this.signature = signature;
	}





	public String getJsapiTicket() {
		return jsapiTicket;
	}

	public void setJsapiTicket(String jsapiTicket) {
		this.jsapiTicket = jsapiTicket;
	}

	public String getOpenId() {
		return openId;
	}

	public void setOpenId(String openId) {
		this.openId = openId;
	}

	public String getPublicAccountId() {
		return publicAccountId;
	}

	public void setPublicAccountId(String publicAccountId) {
		this.publicAccountId = publicAccountId;
	}

	public String getUserName() {
		return userName;
	}

	public void setUserName(String userName) {
		this.userName = userName;
	}

	public static long getSerialversionuid() {
		return serialVersionUID;
	}



	public String getUnionid() {
		return unionid;
	}



	public void setUnionid(String unionid) {
		this.unionid = unionid;
	}
	
}
